<!DOCTYPE html>
<html>
<head>
	<title></title>
	<style>
		
	</style>
</head>
<body>
	
</body>
	<script>
		var list = [99,8,'z','Z','A',6,2,'静静','贱贱','熙熙','哈哈','舒舒','艳艳','波波'];

		console.log(list.length);

		//不会改变原数组的方法
		console.log(list);
		//合并新数组
		console.log('concat: ',list.concat(9));
		console.log('concat: ',list.concat([true,false,666]));
		console.log('concat: ',list.concat(true,false,666));
		console.log('concat: ',list.concat([[1,2,3],[6,8,9]]));
		//将数组连接为字符串
		console.log('join: ',list.join());
		console.log('join: ',list.join('---'));
		//截取数组的一部分
		console.log('slice: ',list.slice(2,4));
		console.log(list);

		//会改变数组的方法
		console.log('-------------------------------------------------');
		console.log(list);
		console.log('push: ',list.push('老王'));
		console.log(list);
		//删除数组最后一个位置的元素,返回被删元素
		console.log("pop: ",list.pop());

		console.log(list);
		//unshuift向数组收割位置追加元素,返回新长度
		console.log('unshift: ',list.unshift('老王'));
		console.log(list);
		//shift删除数组收割位置的元素，返回被删除元素
		console.log('shift: ',list.shift());
		console.log(list);
		//反转数组
		console.log('reverse: ',list.reverse());
		console.log(list);
		//sort ASCII规则
		console.log('sort: ',list.sort());
		console.log(list);

	</script>
</html>